python

Python Introduction

What is Python?

Python is a general purpose and very powerful programming language. Python is taken into account together of the foremost versatile programming language because it can be used to develop almost any kind of application including desktop application , web applications , mobile application , network programming , image processing and lots of more.
Python is a popular programming language. It was created by Guido van Rossum and first released in 1991.

Who manages Python Today?

From version 2.1 onwards, Python is managed by Python Software Foundation situated in Delaware, USA It's a non-profit organization dedicated to the growth and enhancement of Python language. Their website is http://www.python.org .

What can Python do?

Why Python?

Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
• Python can be treated in a procedural way, an object-orientated way or a functional way.
There are numerous examples of popular, high-load websites/webapps that have been developed using Python. Here are some of the most popular of them:

Features of Python

  1. Simple
  2. Python is easy to use, powerful, and versatile, making it a great choice for beginners and experts alike. Python's readability makes it a great first programming language — it allows you to think like a programmer and not waste time with confusing syntax.
  3. Dynamically typed
  4. Python don't have any problem even if we don't declare the type of variable. It states the kind of variable in the runtime of the program. Python also take cares of the memory management which is crucial in programming. So, Python is a dynamically typed language.
  5. Robust
  6. Python has very strict rules which every program must compulsorily follow and if these rules are violated then Python terminates the code by generating “Exception”
  7. Supports multiple programming paradigms
  8. It supports multiple programming paradigms, including structured (particularly, procedural), object-oriented, and functional programming. Python is often described as a "batteries included" language due to its comprehensive standard library. Python supports both procedure-oriented and object-oriented programming which is one of the key python features.
  9. Compiled as well as interpreted
  10. In various books of python programming, it is mentioned that pythonlanguage is interpreted. But that is half correct the python program is first compiled and then interpreted. The compilation part is hidden from the programmer thus, many programmers believe that it is an interpreted language. The compilation part is done first when we execute our code and this will generate byte code and internally this byte code gets converted by the python virtual machine(p.v.m) according to the underlying platform(machine+operating system).
  11. Cross Platform
  12. Python is a cross-platform language: a Python program written on a Macintosh computer will run on a Linux system and vice versa. Python programs can run on Windows computer, as long as the Windows machine has the Python interpreter installed (most other operating systems come with Python pre-installed).
  13. Extensible
  14. Python allows us to call C/C++/Java code from a Python code and thus we say it is an extensible language. We generally use this feature when we need a critical piece of code to run very fast . So we can code that part of our program in C or C++ and then use it from our Python program
  15. Huge library
  16. The Python Standard Library is huge indeed. It can help you do various things like Database Programming , E-mailing ,GUI Programming etc

Python Download and Installation

This document shows downloading and installing Python 3.8.3 on Windows 10 in Summer 2020. You should download and install the newest version of Python. The current latest (as of Summer 2020) is Python 3.8.3
Python: Version 3.8.3
The Python download requires about 25 Mb of space. When installed, Python requires about a further 90 Mb of space.

Downloading

  1. We can download Python from Python website
  2. The website should automatically detect that we are using Windows, Linux/UNIX, Mac OS X or Other. Then Click on Download Python 3.8.3
  3. The file named python-3.8.3.exe should start downloading into your standard download folder. This file is about 25 Mb so it might take a while to download fully if you are on a slow internet connection

Installing

  1. Open the downloads folder and run the file python-3.8.3.exe by right clicking it and selecting run as administrator.
  2. A Python 3.8.3 Setup pop-up window will appear.
  3. Ensure that Add Python 3.8.3 to PATH checkboxes at the bottom are checked.
  4. If the Python Installer finds an earlier version of Python installed on your computer, the Install Now message may instead appear as Upgrade Now (and the checkboxes will not appear).
  5. A new Python 3.8.3 Setup pop-up window will appear with a setup progress message and a progress bar.
  6. Once the installation is over you will get a SETUP WAS SUCCESSFUL message.
  7. Click the Close button.
  8. Python should now be installed.

Verifying

  1. Open Command Prompt
  2. Type the command python –version
  3. In the output we should see the python version number as Python 3.8.3

IDE

An integrated development environment (IDE) is a software application that provides a lot of comprehensive facilities to computer programmers for software development. PyCharm is one of them which is most widely used IDEs for Python programming language. PyCharm is a cross-platform IDE that gives consistent experience on the Windows, macOS, and Linux operating systems. PyCharm is out there in three editions: Professional, Community, and Edu. The Community and Edu editions are open-source projects and that they are free, but they have small no. of features. PyCharm Edu provides courses and helps you learn programming with Python. The Professional edition is commercial, and provides an outstanding set of tools and features.

Installing Pycharm

  1. To download Pycharm visit Jetbrains website
  2. Here you will observe two versions of package for Windows/Mac/Linux
  3. Click the " DOWNLOAD " link under the Community Section.
  4. Once the download is complete, run the exe for install PyCharm. The setup wizard should have started. Click “Next”.
  5. Then mention your destination folder. Click “Next”.
  6. On the next screen, you can create a desktop shortcut if you want and click on “Next”
  7. Click on “Install”
  8. Once installation finished, you should receive a message screen that PyCharm is installed.

Your first Python Program

Now that we have Python up and running, we can write our first Python program.

Let's create a very simple program called Hello World. A "Hello, World!" is a simple program that outputs Hello, World! on the screen. Since it's a very simple program, it's often used to introduce a new programming language to beginners.

Type the following code in any text editor or an IDE and save it as hello_world.py

print("Hello, world!")

Then, run the file. You will get the following output.

Hello, world!

Congratulations! You just wrote your first program in Python.

As you can see, this was a pretty easy task. This is the beauty of Python programming language.